WindThunder ANI_FILE V1.0 Format
Archived from http://www.cinnamonpirate.com/docs/wtani on 2006/2/7
Grudgingly copied and pasted from his browser by D

All animations in WindThunder’s Heroine Anthem I&II are stored in the proprietary ANI_FILE format. Their extension is usually .APS, .000 or .001.

The ANI_FILE format is a running format designed to be streamed and played in real time. It’s a little reminiscent of the ANI-JPEG format that never really caught on.

The format begins with a similar header to the AMP_FILE format used for still graphics, but rather than specifying two file sizes, it specifies a file count. For ‘x’ iterations, the game flies through the images stored in the ANI_FILE. Each image begins with a little endian long file size.

At the end of the file, after all the images, is a data footer controlling the image’s animation. The format of this footer is currently unknown.

ID Tag: 'ANI_FILE V1.0' [14 bytes, string]
Image width [4 bytes, long]
Image height [4 bytes, long]
File count [4 bytes, long]
(file loop)
  File size [4 bytes, long]
  (data)
(end loop)
(footer)

A proof of concept to extract an ANI_FILE to a series of images and a data chunk of the footer is included below:

$filename = '001_2b.aps';
$fd = fopen($filename, 'rb');
if(rtrim(fread($fd,14)) != "ANI_FILE V1.0") die;
$imgwidth = unpack('V*', fread($fd, 4));
$imgheight = unpack('V*', fread($fd, 4));
$count = unpack('V*',fread($fd, 4));
for($i=0; $i< $count; $i++) {
  $filesize = unpack('V*', fread($fd, 4));
  $fo = fopen($filename.'.$i', 'w');
  fputs($fo, fread($fd, $filesize));
  fclose($fo);
}
$fo = fopen($filename.'.dat', "w");
fputs($fo, fread($fd, filesize($filename)-ftell($fo)));
fclose($fo);
fclose($fd);